add_subdirectory(designerintegrationv2)
add_subdirectory(proparser)
add_subdirectory(qtsingleapplication)
add_subdirectory(qtlockedfile)
add_subdirectory(help)
add_subdirectory(registryaccess)

# PCHs used by qmake based plugin builds
qtc_add_public_header(qtcreator_pch.h)
qtc_add_public_header(qtcreator_gui_pch.h)

option(BUILD_QBS "Build Qbs together with Qt Creator" OFF)

add_feature_info("Build Qbs" BUILD_QBS "")
if (BUILD_QBS)
  file(RELATIVE_PATH _REL_PATH_TO_QTC "${CMAKE_BINARY_DIR}" "${PROJECT_BINARY_DIR}")
  set(QBS_OUTPUT_PREFIX "${_REL_PATH_TO_QTC}/" CACHE STRING "" FORCE)
  set(QBS_APP_INSTALL_DIR "${IDE_BIN_PATH}" CACHE STRING "" FORCE)
  set(QBS_LIB_INSTALL_DIR "${IDE_LIBRARY_PATH}" CACHE STRING "" FORCE)
  set(QBS_DLL_INSTALL_DIR "${IDE_BIN_PATH}" CACHE STRING "" FORCE)
  set(QBS_LIBEXEC_INSTALL_DIR "${IDE_LIBEXEC_PATH}" CACHE STRING "" FORCE)
  set(QBS_PLUGINS_INSTALL_BASE "${IDE_PLUGIN_PATH}" CACHE STRING "" FORCE)
  set(QBS_RESOURCES_INSTALL_BASE "${IDE_DATA_PATH}/qbs" CACHE STRING "" FORCE)
  set(QBS_DOC_INSTALL_DIR "${IDE_DOC_PATH}" CACHE STRING "" FORCE)
  set(QBS_HEADERS_INSTALL_DIR "${IDE_DATA_PATH}/qbs/include/qbs" CACHE STRING "" FORCE)

  set(INSTALL_PUBLIC_HEADERS OFF CACHE BOOL "")
  set(WITH_TESTS OFF)
  set(WITH_PROJECT_FILE_UPDATES ON CACHE BOOL "")
  set(QBS_INSTALL_QCH_DOCS ${WITH_DOCS} CACHE BOOL "")
  add_subdirectory(qbs)
endif()
